package com.ktjy.entity;

import com.ktjy.dao.InkBox;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component("printer")
public class Printer {

    @Autowired
//    @Qualifier("colorInk")
    @Qualifier("grayInk")

    private InkBox inkBox;

    public Printer(){}

    public Printer(InkBox inkBox,Page page) {
        this.inkBox = inkBox;
        this.page = page;
    }

    public void setInkBox(InkBox inkBox) {
        this.inkBox = inkBox;
    }

    @Autowired
    private Page page;

    public void setPage(Page page) {
        this.page = page;
    }

    public void print() {
        System.out.println("使用"+inkBox.getColor()+"，纸张的类型是："+page.getType()+",墨盒打印"+page.getContent());
    }


}
